import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'
import { DictItemService } from './dict-item.service'
import { BaseController } from '@/base/base.controller'
import { DictItem } from '@prisma/client'
import { DictItemDto } from './dto/dict-item.dto'
import { ApiOperation, ApiTags } from '@nestjs/swagger'

@ApiTags('字典元素')
@Controller('dict-item')
export class DictItemController extends BaseController<DictItem, DictItemDto> {
  constructor(private readonly dictItemService: DictItemService) {
    super(dictItemService)
  }

  @ApiOperation({ summary: '根据标识获取字典项', description: '根据标识获取字典项' })
  @Get('mark/:dict_mark')
  async getDictItemByMark(@Param('dict_mark') dict_mark: string) {
    return await this.dictItemService.getDictItemByMark(dict_mark)
  }
}
